QUERY PLAN ------------------------------------------------------------------------------------- Append (cost=30833.12..1117248.88 rows=27596000 width=8) -> Hash Join (cost=30833.12..34917.13 rows=5000 width=8) Hash Cond: (check_test_div.id = inner_t.id) Join Filter: (check_test_div.id = inner_t.id) -> Seq Scan on check_test_div (cost=0.00..0.00 rows=1 width=12) -> Hash (cost=14425.50..14425.50 rows=1000050 width=8) -> Seq Scan on inner_t (cost=0.00..14425.50 rows=1000050 width=8) -> Hash Join (cost=19488.25..216466.35 rows=5518200 width=8) Hash Cond: (check_test_div_0.id = inner_t.id) Join Filter: (check_test_div_0.id = inner_t.id) -> Seq Scan on check_test_div_0 (cost=0.00..3289.28 rows=220728 width=12) -> Hash (cost=19425.75..19425.75 rows=5000 width=8) -> Seq Scan on inner_t (cost=0.00..19425.75 rows=5000 width=8) Filter: ((id % 5) = 0) -> Hash Join (cost=19488.25..216466.35 rows=5518200 width=8) Hash Cond: (check_test_div_1.id = inner_t.id) Join Filter: (check_test_div_1.id = inner_t.id) -> Seq Scan on check_test_div_1 (cost=0.00..3289.28 rows=220728 width=12) -> Hash (cost=19425.75..19425.75 rows=5000 width=8) -> Seq Scan on inner_t (cost=0.00..19425.75 rows=5000 width=8) Filter: ((id % 5) = 1) -> Hash Join (cost=19488.25..216466.35 rows=5518200 width=8) Hash Cond: (check_test_div_2.id = inner_t.id) Join Filter: (check_test_div_2.id = inner_t.id) -> Seq Scan on check_test_div_2 (cost=0.00..3289.28 rows=220728 width=12) -> Hash (cost=19425.75..19425.75 rows=5000 width=8) -> Seq Scan on inner_t (cost=0.00..19425.75 rows=5000 width=8) Filter: ((id % 5) = 2) -> Hash Join (cost=19488.25..216466.35 rows=5518200 width=8) Hash Cond: (check_test_div_3.id = inner_t.id) Join Filter: (check_test_div_3.id = inner_t.id) -> Seq Scan on check_test_div_3 (cost=0.00..3289.28 rows=220728 width=12) -> Hash (cost=19425.75..19425.75 rows=5000 width=8) -> Seq Scan on inner_t (cost=0.00..19425.75 rows=5000 width=8) Filter: ((id % 5) = 3) -> Hash Join (cost=19488.25..216466.35 rows=5518200 width=8) Hash Cond: (check_test_div_4.id = inner_t.id) Join Filter: (check_test_div_4.id = inner_t.id) -> Seq Scan on check_test_div_4 (cost=0.00..3289.28 rows=220728 width=12) -> Hash (cost=19425.75..19425.75 rows=5000 width=8) -> Seq Scan on inner_t (cost=0.00..19425.75 rows=5000 width=8) Filter: ((id % 5) = 4) (42 rows)